Release 10.1A: OpenEdge Development:
Java Open Clients
Type interface
The Java SDO
Typeinterface represents a common view of a data type. ATypehas aClassobject associated with it. For example, aTyperepresenting a simple data type might have thejava.lang.Integerclass associated with it. ATyperepresenting a complex data type might have aCustomerclass associated with it. Thus,java.lang.Classimplements the Java SDOTypeinterface.So, both a
DataObjectand aPropertyobject has aTypeassociated with it. Typically, theTypeof aDataObjectis a complex data type like theCustomerclass, and the type of aPropertyis a simple data type like thejava.lang.Integerclass. ATypethat represents a complex data type also has aPropertylist associated with it. So, for example, aTyperepresenting theCustomerclass has a list ofPropertyobjects corresponding to theCustomercolumns or fields. ATypethat corresponds to a simple data type defines noPropertylists.In the
ProDataGraphmodel, a temp-table defined by aProDataObjectMetaDataobject has aTypewith aPropertylist that includes column properties, which map to the temp-table fields, and reference properties, which implement any data-relations specified by aProDataRelationMetaDataobject. Each of the properties in this list also has a Type. So, both theDataObject(orProDataObjectfor aProDataGraph) and its list ofPropertyobjects have agetType()method that returns theTypeof the respective object.Methods
The Java SDO
Typeinterface provides these methods:
- getInstanceClass( ) and getClass( ) — These methods return the Java class that this
Typerepresents. If this is theTypeof a reference property,getInstanceClass()returnsnull:
- getProperties( ) — This method returns the list of the properties for the
Typeof aDataObject. For aTyperepresenting the simple data type of aProperty(for example,java.lang.Integer), it returnsnull:
- getProperty( ) — This method returns the property with the specified name from the property list of a
DataObjectType. For a column property of aProDataObject,propNameis also the 4GL name of a corresponding temp-table field:
- isInstance( ) — This method returns whether the specified object is an instance of this
Type. For example, ifTyperepresents theCustomerclass andobjis aDataObjectwhoseTyperepresents theCustomerclass, this method returnstrue:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |